<include file="Public:header" />
  <js href="__PUBLIC__/ueditor/ueditor.config.js" />    
    <js href="__PUBLIC__/ueditor/ueditor.all.min.js" />
    <script>
    $(function(){
        var url='{:U('Admin/Ueditor/Index')}';
        var ue = UE.getEditor('container',{
            serverUrl :url,
            UEDITOR_HOME_URL:'__PUBLIC__/ueditor/',
            initialFrameHeight: 800 ,
            
        });

        ue.ready(function(){
            ue.execCommand('serverparam', {
                'userid': '1',
               'username': 'admin',
            });
        });
      

    })
     
    </script>
     <script type="text/javascript">
       $(document).ready(function() {
           
             $(".saveContent").click(function() {
              var action = '{:U('Admin/Admin/addDraftProcess')}';
              $("form:first").attr("action",action);
              $("form:first").submit();
             });
        });
       
     </script>

 <body>
     <div class='panel'>
        <div class='panel-heading'>撰写文章</div>
        <div class='panel-body'>

        
        <form class="form-inline" role="form" method='post'  action="{:U('Admin/Admin/addContentProcess')}">
           <p>
           <div class="form-group">                              
            <label class="control-label required">标题</label>&nbsp;&nbsp;
            <input type='text' name='title' id='title' value='{$Think.cookie.addcontent_title}' class='form-control'
             placeholder='' style="width:600px"/>
          </div></p>
         
         <p>
           <div class="form-group">
            <label class="control-label required">来源</label>&nbsp;&nbsp;
      
                <input type='text' name='author' id='author' value='<php>
                       $addcontent_author = cookie('addcontent_author');
                       if(empty($addcontent_author)){
                        echo getSiteOption('defaultAuthor');                       
                       }else{
                        echo $addcontent_author;
                       }</php>' 
                       class='form-control' style="width:600px" />
           
           </div>
          </p>

          <p>            
          <div class="form-group">
            <label class="control-label required">分类</label>&nbsp;&nbsp;
         
                <select name='c_id' id='categories' class='select form-control chosen'>
                <foreach name='category' item='category'>
                    <option value ="{$category.id}"<if condition="$Think.cookie.addcontent_c_id eq $category.id ">selected='selected'<else />  </if> >{$category.title}</option>
                </foreach>
                </select>
          </div>&nbsp;

          <div class="form-group">                      
             <div class="input-group date form-date" data-date="" data-date-format="dd MM yyyy" data-link-format="yyyy-mm-dd hh:ii" style="width:300px">
             <span class="input-group-addon">定时发布</span>            
                <input type='text' name='time' id='time' class='form-control' placeholder="留空为即时发布" style="ime-mode:inactive"/>
                <span class="input-group-addon"><span class="icon-remove"></span></span>
                <span class="input-group-addon"><span class="icon-calendar"></span></span>
                </div>
          </div>
          <div class="form-group">  
          <input type="submit" value='发布' class="btn btn-primary" />
          <input type="button" value='保存草稿'class="saveContent btn btn-primary" />
          </div>
          </p>


    <link href="__PUBLIC__/zui/lib/datetimepicker/datetimepicker.min.css" rel="stylesheet" type="text/css">
    <script src="__PUBLIC__/zui/lib/datetimepicker/datetimepicker.min.js"></script>
    <script>
        $('.form-date').datetimepicker({
            language:  'zh-CN',
            weekStart: 1,
            todayBtn:  1,
            autoclose: 1,
            todayHighlight: 1,
            startView: 2,
            minView: 2,
            forceParse: 0,
            format: 'yyyy-mm-dd hh:ii'
        });
    </script>





          <p>


          <div class="form-group">
            <label class="control-label">内容</label>           
              <script id="container" name="content" type="text/plain">{$Think.cookie.addcontent_content}</script>          
          </div>
          <br>
        

          <div class="form-group">
            <div class="col-md-offset-2 col-md-10">
                <input type="submit" value='发布' class="btn btn-primary" />
                <input type="button" value='保存草稿'class="saveContent btn btn-primary" />
            </div>
          </div>
            
        </form>
        </p>
        </div>

      </div>
     
  
 </body>
</html>
